/******************************************************************************
 * (c) 2011 Komersi Software                                                  *
 * www.komersisoftware.com                                                    *
 *                                                                            *
 * This file is part of Tadah                                                 *
 * Licensed under GNU General Public License v2.0                             *
 * Check LICENSE.TXT for more information                                     *
 ******************************************************************************/
 
#ifndef _COLUMN_H_
#define _COLUMN_H_

#include "definitions.h"

typedef enum primary_index_type
{
	IsPrimaryIndex,
	IsNotPrimaryIndex
} primary_index_type_t;

typedef enum data_type
{
	Char,
	Int
} data_type_t;

typedef struct ddl_column
{
  char name[COLUMN_NAME_LENGTH + sizeof(char)];
  data_type_t type;
  int size;
  primary_index_type_t primary_index;

  struct ddl_column *next;
} ddl_column_t;

int column_list_add(ddl_column_t **list, ddl_column_t *item);
ddl_column_t *new_ddl_column(char *name, data_type_t type, int size, primary_index_type_t primary_index);
void dispose_column_list(ddl_column_t **list);
void set_column_as_primary_index(ddl_column_t *item);

#endif //_COLUMN_H_
